<script type="text/javascript">
    $(document).ready(function() {
        // date picker
        $(".tanggal").datepicker({
            yearRange: '-1:+1',
            target: 'tanggal',
            changeMonth: true,
            changeYear: true,
            showOn: 'both',
            buttonImage: '{$BASEURL}/resource/doc/images/icon/calendar.gif',
            buttonImageOnly: true,
            dateFormat: 'yy-mm-dd'
        });
    });
</script>
<div class="breadcrum">
    <p>
        <a href="#">Inventarisasi</a>
        <span></span><a href="{$config->site_url('inventarisasi/pengadaan')}">Pengadaan</a>
        <span></span><small>Edit</small>
    </p>
    <div class="clear"></div>
</div>  
<div class="sub-content">  
    <div class="navigation">  
        <div class="navigation-button">
            <ul>
                <li><a href="{$config->site_url('inventarisasi/pengadaan/add')}"><img alt="" src="{$BASEURL}/resource/doc/images/icon/add-icon.png">Tambah Data</a></li>
                <li><a href="{$config->site_url('inventarisasi/pengadaan')}"><img alt="" src="{$BASEURL}/resource/doc/images/icon/icon.notes.blue.png">Daftar Data</a></li> 
            </ul>
            <div class="clear"></div>
        </div>
    </div> 
    <!-- notification template -->
    {include file="base/templates/notification.html"}
    <!-- end of notification template--> 
    <form action="{$config->site_url('inventarisasi/pengadaan/edit_process')}" method="post" enctype="multipart/form-data">
        <input type="hidden" name="pengadaan_id" value="{$result.pengadaan_id|default:''}">
        <input type="hidden" name="pengadaan_nomor_asli" value="{$result.pengadaan_nomor|default:''}">
        <table width="100%" class="table-input">
            <tbody>
                <tr class="headrow">
                    <th colspan="4">Edit Pengadaan</th>
                </tr>
                <tr>
                    <td width="15%">Nomor Pengadaan</td>
                    <td width="85%">
                        <input type="text" maxlength="30" size="30" name="pengadaan_nomor" value="{$result.pengadaan_nomor|default:''}">
                        <small>* wajib diisi</small>
                    </td>  
                </tr>
                <tr>
                    <td>Tanggal</td>
                    <td>
                        <input class="tanggal" name="pengadaan_date" type="text" value="{$result.pengadaan_date|default:''}" size="10" maxlength="10" readonly="readonly" />
                        <small>* wajib diisi</small>
                    </td>  
                </tr> 
                <tr>
                    <td>Bagian</td>
                    <td>
                        <select name="bagian_cd" id="bagian_cd" style="width:300px;">
                            <option value=""></option>
                            {foreach from=$rs_bagian item=data}
                            <option value="{$data.bagian_cd|default:''}" {if {$result.bagian_cd|default:''} eq $data.bagian_cd}selected="selected"{/if}>{$data.bagian_name}</option>
                            {/foreach}
                        </select>
                        <small>* wajib diisi</small>
                    </td>     
                </tr>   
                <tr>
                    <td>Upload Invoice</td>
                    <td> 
                        {if {$result.pengadaan_att_surat|default:''} neq ''}  
                            <a href="{$filepath}{$result.pengadaan_att_surat}" data-lightbox="image-1" title="Pengadaan Nomor Surat : {$result.pengadaan_nomor|default:''}">
                                <img width="100px" height="100px" src="{$filepath}{$result.pengadaan_att_surat}" />
                            </a>
                        {/if}<br /><br />
                        <input name="pengadaan_att_surat" type="file"/>
                    </td>  
                </tr> 
                <tr>
                    <td>Keterangan</td>
                    <td><textarea name="pengadaan_keterangan" rows="5" cols="50">{$result.pengadaan_keterangan|default:''}</textarea></td>  
                </tr> 
                <tr class="submit-box">
                    <td colspan="4">
                        <input type="submit" class="edit-button" value="Simpan" name="save[insert]">
                        <input type="reset" class="edit-button" value="Reset" name="save[reset]">
                    </td>
                </tr>
            </tbody>
        </table>
    </form> 
</div>